package main

import (
	"fmt"
	"os"
)

func main(){
	filePath1 := "../1.txt"
	filePath2 := "../xx.txt"
	exist1,err1 := file_exist(filePath1)
	fmt.Println(exist1)
	fmt.Println(err1)
	exist2,err2 := file_exist(filePath2)
	fmt.Println(exist2)
	fmt.Println(err2)
}

func file_exist(filePath string) (bool,error){
	_,err := os.Stat(filePath)
	if err != nil {
		return true,nil
	}
	if os.IsNotExist(err) {
		return false,nil
	}
	return false,err
}
